//大合集 按照输入数据长度来自动判断
function submit(){
	var tc=document.getElementsByName("sctext")[0];
	
	var url;
	switch(tc.value.length){
	case 18:window.location.href="http://localhost:8080/searchbyuid?Uid="+decodeURI(tc.value);break;
	case 2:{
	if(tc.value=="出校"){window.location.href="http://localhost:8080/in_or_leaveschool?inorLeave=1";break;}
	else if(tc.value=="进校"){ window.location.href="http://localhost:8080/in_or_leaveschool?inorLeave=0";break;}
	}
	default:window.location.href="http://localhost:8080/searchbyname?Name="+decodeURI(tc.value);break;
	}
}
//定时调用 在校人数函数 目前出现除了匿名类函数只能单次执行问题
setInterval(function (){
　  $.ajax({
	   url:"search_in",
	   method:"post",
	   data:{
	   },
	   dataType:"json",
	    success:function(data){
	   if(data.status=="success")
	   {
		document.getElementById('num').innerText=data.num;
	   }
	  }});
}, 1000);
